UEVENT Statements Action Enable, disable, or suspend a user-defined event. Syntax UEVENT ON UEVENT OFF UEVENT STOP Remarks The effects of the UEVENT statements are like those of other event-trapping statements (such as COM or KEY). When UEVENT ON is executed, the event-trapping routine is enabled. Occurrences of the event trigger execution of the event-handling routine. When UEVENT OFF is executed, the event-trapping routine is disabled. Any occurrences of the event are ignored. When UEVENT STOP is executed, the event-trapping routine is suspended. An event occurrence is remembered, and the event-trapping routine performed as soon as a UEVENT ON statement is executed. When a user-defined event trap occurs (that is, the GOSUB is performed), an automatic UEVENT STOP is executed so that recursive traps cannot take place. The RETURN operation from the trapping subroutine automatically performs a UEVENT ON statement unless an explicit UEVENT OFF was performed inside the subroutine. See Also ON event, SetUEvent Example The following example shows a primitive use of the ON UEVENT statement. PRINT "Entering an odd number causes a UEVENT to occur." ON UEVENT GOSUB Event1 UEVENT ON DO PRINT "Enter a number --> "; N = VAL(INPUT$(1)). PRINT N. PRINT SELECT CASE N CASE 1, 3, 5, 7, 9 CALL SetUevent 'Odd number was entered, causing UEVENT. CASE ELSE PRINT "No UEVENT occurred.". PRINT END SELECT LoopCount = LoopCount + 1 LOOP UNTIL LoopCount = 10 Event1. PRINT "Now processing the UEVENT. The odd number was"; N RETURN